import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/home/index',
    name: 'homeIndex',
    redirect: '/home/Main',
    component: () => import('../views/home/Index'),
    children: [
      {
        path: '/home/Main',
        name: 'homeMain',
        meta: {title: '首页'},
        component: () => import('../views/home/Main'),
      },
      {
        path: '/note/Index',
        name: 'noteIndex',
        meta: {title: '笔记'},
        component: () => import('../views/note/Index'),
      },
      {
        path: '/programme/Index',
        name: 'programmeIndex',
        meta: {title: '方案'},
        component: () => import('../views/programme/Index'),
      },
      {
        path: '/essay/Index',
        name: 'essayIndex',
        meta: {title: '杂文'},
        component: () => import('../views/essay/Index'),
      },
      {
        path: '/networkarticle/Index',
        name: 'networkarticleIndex',
        meta: {title: '网络好文'},
        component: () => import('../views/networkarticle/Index'),
      },
      {
        path: '/networkworks/Index',
        name: 'networkworksIndex',
        meta: {title: '网络案例'},
        component: () => import('../views/networkworks/Index'),
      },
      {
        path: '/user/Index',
        name: 'userIndex',
        meta: {title: '关于博主'},
        component: () => import('../views/user/Index'),
      },
      {
        path: '/leaving/Index',
        name: 'leavingIndex',
        meta: {title: '问题反馈'},
        component: () => import('../views/leaving/Index'),
      },
      {
        path: '/website/Index',
        name: 'websiteIndex',
        meta: {title: '博主收藏'},
        component: () => import('../views/website/Index'),
      },
      {
        path: '/works/Index',
        name: 'worksIndex',
        meta: {title: '作品分享'},
        component: () => import('../views/works/Index'),
      },
      {
        path: '/travels/Index',
        name: 'travelsIndex',
        meta: {title: '记录生活'},
        component: () => import('../views/travels/Index'),
      },
      {
        path: '/link/Index',
        name: 'linkIndex',
        meta: {title: '友情链接'},
        component: () => import('../views/link/Index'),
      },
      {
        path: '/content/Index',
        name: 'contentIndex',
        meta: {title: '内容页'},
        component: () => import('../views/content/Index'),
      },
    ]
  },
  {
    path: '/retrieval/Index',
    name: 'retrievalIndex',
    meta: {title: '检索'},
    component: () => import('../views/retrieval/Index'),
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
